All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JCheckBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.AbstractButton
                                   |
                                   +----com.sun.java.swing.JToggleButton
                                           |
                                           +----com.sun.java.swing.JCheckBox

public class JCheckBox
extends JToggleButton
implements Accessible
An implementation of a CheckBox -- an item that can be selected or deselected, and which displays its state to the user. In a group of checkboxes, multiple checkboxes can be selected. See How to Use CheckBoxes in The Java Tutorial for further documentation.

For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JCheckBox key assignments.

Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.

See Also:
JRadioButton

Constructor Index

 o JCheckBox()
Creates an initially unselected checkbox button with no text, no icon.
 o JCheckBox(Icon)
Creates an initially unselected checkbox with an icon.
 o JCheckBox(Icon, boolean)
Creates a checkbox with an icon and specifies whether or not it is initially selected.
 o JCheckBox(String)
Creates an initially unselected checkbox with text.
 o JCheckBox(String, boolean)
Creates a checkbox with text and specifies whether or not it is initially selected.
 o JCheckBox(String, Icon)
Creates an initially unselected checkbox with the specified text and icon.
 o JCheckBox(String, Icon, boolean)
Creates a checkbox with text and icon, and specifies whether or not it is initially selected.

Method Index

 o getAccessibleContext()
Get the AccessibleContext associated with this JComponent
 o getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.
 o updateUI()
Notification from the UIFactory that the L&F has changed.

Constructors

 o JCheckBox
 public JCheckBox()
Creates an initially unselected checkbox button with no text, no icon.

 o JCheckBox
 public JCheckBox(Icon icon)
Creates an initially unselected checkbox with an icon.

Parameters:
icon - the Icon image to display
 o JCheckBox
 public JCheckBox(Icon icon,
                  boolean selected)
Creates a checkbox with an icon and specifies whether or not it is initially selected.

Parameters:
icon - the Icon image to display
selected - a boolean value indicating the initial selection state. If true the checkbox is selected
 o JCheckBox
 public JCheckBox(String text)
Creates an initially unselected checkbox with text.

Parameters:
text - the text of the checkbox.
 o JCheckBox
 public JCheckBox(String text,
                  boolean selected)
Creates a checkbox with text and specifies whether or not it is initially selected.

Parameters:
text - the text of the checkbox.
selected - a boolean value indicating the initial selection state. If true the checkbox is selected
 o JCheckBox
 public JCheckBox(String text,
                  Icon icon)
Creates an initially unselected checkbox with the specified text and icon.

Parameters:
text - the text of the checkbox.
icon - the Icon image to display
 o JCheckBox
 public JCheckBox(String text,
                  Icon icon,
                  boolean selected)
Creates a checkbox with text and icon, and specifies whether or not it is initially selected.

Parameters:
text - the text of the checkbox.
icon - the Icon image to display
selected - a boolean value indicating the initial selection state. If true the checkbox is selected

Methods

 o updateUI
 public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JToggleButton
See Also:
updateUI
 o getUIClassID
 public String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.

Returns:
"CheckBoxUI"
Overrides:
getUIClassID in class JToggleButton
See Also:
getUIClassID, getUI
 o getAccessibleContext
 public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this JComponent

Returns:
the AccessibleContext of this JComponent
Overrides:
getAccessibleContext in class JToggleButton

All Packages  Class Hierarchy  This Package  Previous  Next  Index